<?php
namespace Admin\Model;
use Think\Model;

class SubjectModel extends Model {

    protected $_validate = array (
		array('name','require','请输入投票主题', 1 , unique , Model::MODEL_INSERT),
		array('endTime','require','请选择投票截止日期', 1 , 0 , Model::MODEL_BOTH),
    );	

    protected $_auto = array (
		array('createTime','time',Model::MODEL_INSERT,'function'),		
		array('updateTime','time',Model::MODEL_BOTH,'function'),	
		array('endTime','_endTime',Model::MODEL_BOTH,'callback'),
	);

	protected function _endTime(){
		return strtotime(I('post.endTime')); 
	}

}
?>